<template>
  <div class="head-icon">
    <div class="head-img">
      <div class="icon-bg" :class="className"></div>
    </div>
    <div class="wrapper" :class="assetsTitle" @click="_goPage" >
      <div class="price" v-if="$route.path !== '/balance'">
        <span>{{price}}</span>
      </div>
      <div class="text" v-if="$route.path !== '/balance'">
        <span>{{text}}</span>
        <span>&gt;</span>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'HeadIcon',
    props: {
      className: {
        type: String,
      },

      assetsTitle: {
        type: String,
      },

      price: {
        type: Number,
        default: 0.0,
      },
      text: {
        type: String,
        default: '当前余额',
      },
    },
    methods: {
      /**
       * 跳转
       * @private
       */
      _goPage() {
        this.$router.push('/balance')
      },
    },
  }
</script>
